package com.yc.jpyy.mobile.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;

import com.yc.jpyy.base.dao.BaseDao;

public interface BizDao extends BaseDao {

	// 获取学员基本信息
	Map<String, Object> getStudentInfo(@Param("userId") String userId)
			throws DataAccessException;

	// 修改学员头像
	int UpdatePhoto(@Param("studentPhoto") String studentPhoto,
			@Param("userId") String userId) throws DataAccessException;

	// 获取学员原头像
	String GetStudentPhoto(@Param("userId") String userId)
			throws DataAccessException;

	// 获取指定县区编号内的驾校
	List<Map<String, Object>> SelectDriverSchools(
			@Param("RegionNo") String RegionNo) throws DataAccessException;

	// 修改学员基础信息表的gid
	int updateStuGid(Map<String, Object> paramsMap) throws DataAccessException;

	// 修改学员图片
	int updateUserImage(@Param("userImage") String userImage,
			@Param("userId") String userId) throws DataAccessException;

	// 查询提醒时间
	List<Map<String, Object>> checkRemind(@Param("minute") int minute)
			throws DataAccessException;

	// 检查是否有最新推送公告
	List<Map<String, Object>> checkSysAnn(@Param("minute") int minute)
			throws DataAccessException;

	// 获取修改课程信息
	List<Map<String, Object>> getUpdateCourseNo(@Param("minute") int minute)
			throws DataAccessException;

	// 取消后给学生的学时 加 1
	void addSurplusStudyTime(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询是否有未评价的课程
	Map<String, Object> getStudyExam(@Param("stuId") String userId)
			throws DataAccessException;

	// 获取系统配置的
	Map<String, Object> getSysConfig() throws DataAccessException;

	// 获取学车类型
	List<Map<String, Object>> SetLearnDrivingTypeDB(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 获取收藏答题
	List<Map<String,Object>> getCollectionQuestions(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 获取错题答题
	List<Map<String,Object>> getWrongQuestions(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 删除错题记录
	int deleteWrongQuestions(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 获取模拟答题
	List<Map<String,Object>> getSimulateQuestions(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 获取难题答题
	List<Map<String,Object>> getDifficultQuestions(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 获取分数
	Map<String,Object> getScores(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 查询用户是否有收藏记录
	int getCollectRecord( @Param("Id") String Id, @Param("userId") String userId) throws DataAccessException;	
	
	// 获取模考信息
	List<Map<String,Object>> getSimulateInfo(
			Map<String, Object>paramsMap) throws DataAccessException;

	// 获取专项练习题
	List<Map<String,Object>> getSpecialTypeQuestion(Map<String, Object>paramsMap) throws DataAccessException;

	// 查询答题记录
	int selectAnswerQuestionId(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 添加答题记录
	int addAnswerQuestion(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 更改答题记录
	int updateAnswerQuestion(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 更改答题表中的错题记录数
	int updateAnswerQuestionError(Map<String, Object> paramsMap) throws DataAccessException;

	// 查询错题表
	int selectWrongQuestion(Map<String, Object> paramsMap) throws DataAccessException;	
	
	// 添加错误问题
	int addWrongQuestion(Map<String, Object> paramsMap) throws DataAccessException;

	// 查询收藏问题
	int selectQuestionCollect(Map<String, Object> paramsMap) throws DataAccessException;	
	
	// 添加收藏问题
	int addQuestionCollect(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 取消收藏问题
	int deleteQuestionCollect(Map<String, Object> paramsMap) throws DataAccessException;

	// 添加模考记录
	int addExamRecord(Map<String, Object> paramsMap) throws DataAccessException;

	// 驾校信息查询--参数机构id
	List<Map<String, Object>> getDriveSchoolInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 驾校详情信息查询--参数驾校id
	List<Map<String, Object>> getDriveSchoolDetailInfo(
			@Param("driverId") int driverId, @Param("imgUrl") String imgUrl)
			throws DataAccessException;

	// 分校驾校详情信息查询--参数驾校id
	List<Map<String, Object>> getBranchDriveSchoolDetailInfo(
			@Param("driverId") int driverId, @Param("imgUrl") String imgUrl)
			throws DataAccessException;

	// 根据驾校ID获取班型--参数驾校id
	List<Map<String, Object>> getClassInfoByDriverId(Map<String, Object> hashMap)
			throws DataAccessException;

	// 获取该教练下的所有班型ID
	String getClassIds(String teacherId) throws DataAccessException;

	// 添加报名意向
	int AddPreRegistration(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 驾校信息查询--参数驾校名称
	List<Map<String, Object>> getDrivesInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 题目查询
	List<Map<String, Object>> getRandomQuestionInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 题目查询章节类型
	List<Map<String, Object>> getParmQuestionInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 题目查询获取所有
	List<Map<String,Object>> getAllQuestionInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 根据题目ID获取选项
	List<Map<String,Object>> getQuestionItemInfo(
			@Param("questionId") String questionId) throws DataAccessException;

	// 根据驾校ID获取教练下拉
	List<Map<String, Object>> getTeacherListBySchoolID(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 根据区县编号教练信息
	List<Map<String, Object>> getTeacherListByRegion(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 根据教练ID获取教练详情
	Map<String, Object> getTeacherDetailById(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 根据学员ID获取意见反馈下拉
	List<Map<String, Object>> getFeedbackListInfo(@Param("stuId") int stuId)
			throws DataAccessException;

	// 注册添加
	int UserRegisterInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 是否注册
	int getRegisterCount(@Param("userName") String userName)
			throws DataAccessException;

	// 根据手机号获取最新学员ID
	List<Map<String, Object>> getStudentID(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 获取激活码是否使用
	Map<String, Object> getCodeIsUse(Map<String, Object> paramsMap)
				throws DataAccessException;
	
	// 更改激活码状态
	int updateCodeStatus(Map<String, Object> paramsMap)throws DataAccessException;
	
	// 更改学员状态
	int updateStuStatus(Map<String, Object> paramsMap)throws DataAccessException;

	// 根据学员Id在账户表中查询该学员是否已绑定
	int getIsBind(@Param("studentid") int studentid) throws DataAccessException;
	// 根据学员Id在学员信息表中查询该学员是否已绑定
	int checkIsBind(@Param("studentid") int studentid) throws DataAccessException;

	// 绑定用户
	int BindUserInfo(Map<String, Object> paramsMap) throws DataAccessException;

	
	// 查询用户是否存在
	int queryUser(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 登录
	List<Map<String, Object>> LoginSystemInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取章节分类
	List<Map<String, Object>> getSecondConfigInfo(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 获取专项分类
	List<Map<String,Object>> getSpecialSecondConfig(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 获取内容类型试题数量
	Map<String, Object> selectContentQuesCounts(
			Map<String, Object> paramsMap) throws DataAccessException;
	// 获取试题类型试题数量
	Map<String, Object> selectTypeQuesCounts(
			Map<String, Object> paramsMap) throws DataAccessException;
	// 获取知识点类型试题数量
	Map<String, Object> selectKnowQuesCounts(
			Map<String, Object> paramsMap) throws DataAccessException;
	
	// 获取学员旧密码
	String getStudentOldPwdByTel(@Param("mobilePhone") String mobilePhone)
			throws DataAccessException;

	// 修改学员登录密码
	int updateStuPwd(@Param("pwd") String pwd,
			@Param("mobilePhone") String mobilePhone)
			throws DataAccessException;

	// 获取公告信息
	List<Map<String, Object>> getNews(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取前三张驾校照片
	List<Map<String, Object>> getDriverSchoolPhotos(
			@Param("imgUrl") String imgUrl) throws DataAccessException;

	// 获取报名信息
	List<Map<String, Object>> getPreRegistrationByTel(
			@Param("studentTel") String studentTel) throws DataAccessException;

	// 获取学员已学、未学视频课程
	List<Map<String, Object>> getStudentLearnVideo(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 获取用户已学、未学视频课程
	List<Map<String, Object>> getUserLearnVideo(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 获取视频所属课程列表
	List<Map<String, Object>> getCurVideo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 添加意见反馈信息
	int addFeedBack(Map<String, Object> paramsMap) throws DataAccessException;

	// 获取学时
	Map<String, Object> getLearnTimeByStuId(
			@Param("studentId") String studentId, @Param("imgUrl") String imgUrl)
			throws DataAccessException;

	// 获取预约学时信息
	Map<String, Object> getAppointmentLearnTimeByStuId(
			@Param("studentId") String studentId) throws DataAccessException;

	// 获取班型名称
	List<Map<String, Object>> getClassTypeById(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取购物车数量
	String getShopCount(String studentId) throws DataAccessException;

	// 获取学习明细信息
	List<Map<String, Object>> getStudyRecordDetailByStuIdAndSubjectID(
			@Param("studentId") String studentId) throws DataAccessException;

	// 获取个人信息（根据电话号码）
	Map<String, Object> getPersonalInformationByTel(Map<String, Object> parm)
			throws DataAccessException;

	// 获取我的信息（根据ID）
	Map<String, Object> getMyInformationById(Map<String, Object> parm)
			throws DataAccessException;

	// 根据电话号码修改学员账号表
	int updateStudentAccountByphone(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 查询电话号码是否已经被其他账户使用
	int selectPhone(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 累加驾校咨询数量
	int updateDriveSchoolConsultNum(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 课程评价接口--
	int CurriculumEvaluation(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 获取课程评价接口--
	List<Map<String,Object>> getCourseEvaluate(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 预约表是否已存在
	int isExisitAppointment(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 修改预约记录为已预约
	void updateCourseAppointment(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 预约记录接口
	void CourseAppointment(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 取消预约页面---查询详细课程信息 根据课程编号查询
	List<Map<String, Object>> CancelAppointInfo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 课程已约数量+1
	Integer AddReleaseCourseCount(@Param("CourseID") int CourseID)
			throws DataAccessException;

	// 课程已约数量-1
	Integer DelReleaseCourseCount(@Param("CourseID") int CourseID)
			throws DataAccessException;

	// 取消预约记录接口
	int deleteCourseAppointment(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询未开课程
	List<Map<String, Object>> NoCourseHistory(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 待评价课程
	List<Map<String, Object>> waitCourseHistory(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 完成课程
	List<Map<String, Object>> finishCourseHistory(@Param("stuid") String stuid)
			throws DataAccessException;

	// 更具课程编号查预约记录编号
	Integer queryCourseNo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 条件查询预约记录编号
	Integer finishQueryCourseNo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询详细课程信息
	List<Map<String, Object>> detailsClass(@Param("Id") int Id,
			@Param("imgUrl") String imgUrl) throws DataAccessException;

	// 获取课程列表
	List<Map<String, Object>> getReleaseCourse(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取课程列表
	List<Map<String, Object>> GetTecReleaseCourse(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询详细课程信息
	List<Map<String, Object>> GetTecRAppointmentInfo(
			@Param("courseid") int courseid, @Param("imgUrl") String imgUrl)
			throws DataAccessException;

	// 照片上传
	int Insertcheckpic(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 更新 StudyStat_Query
	int updateStudyStat_Query(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 更新 StudyStat_Student
	int updateStudyStat_Student(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 更新 StudyStatByDay
	int updateStudyStatByDay(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取照片
	List<Map<String, Object>> getphotobystuid(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取参数
	Map<String, Object> getSubjectParambysubjectid(
			@Param("subjectid") int subjectid) throws DataAccessException;

	// 根据学员id获取query数据
	Map<String, Object> getStudyStat_Querybystuid(@Param("userid") int userid)
			throws DataAccessException;

	// 根据科目id、学驾类型获取大纲数据
	Map<String, Object> getSchoolSubjectsbysubid(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 学习结果表
	int InsertStuExamResult(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 预约是更新学时表
	int updateSurplusStudyTimes(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 根据学员ID获取学驾类型
	Map<String, Object> getdrivetypebystuid(@Param("userid") int userid)
			throws DataAccessException;

	// 获取可用学时
	Map<String, Object> SelectSumSurplusStudyTimes(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 取消预约时更新学时余额表
	int DelupdateSurplusStudyTimes(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询黑名单记录
	int getBlackRecord(Map<String, Object> paramsMap)
			throws DataAccessException;
	// 根据课程ID获取可约学员数
	Map<String, Object> FindappointmentCount(Map<String, Object> paramsMap)
			throws DataAccessException;
	
	// 根据课程ID获取可约学员数
	int findAppointmentByTime(Map<String, Object> paramsMap)
				throws DataAccessException;

	// 获取最大电子教学日志编号
	String getMaxRecnum() throws DataAccessException;

	// 新增电子教学日表数据
	int addStudyRecordResult(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 学习照片上传
	int addStudyPhoto(Map<String, Object> paramsMap) throws DataAccessException;

	// 视频学习照片上传
	int addVideoPhoto(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 添加视频学习记录（根据用户进行添加）
	int addVideoRecord(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 查询视频学习记录数
	int selectVideoCount(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 更改视频学习记录数
	int updateVideoCount(Map<String, Object> paramsMap) throws DataAccessException;
	
	// 添加视频学习记录数
	int addVideoCount(Map<String, Object> paramsMap) throws DataAccessException;

	// 获取已学视频课程
	List<Map<String, Object>> getValidLearnVideo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 获取未学视频课程
	List<Map<String, Object>> getInvalidLearnVideo(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 2.1 学员基本信息获取-终端
	List<Map<String, Object>> getStudentInfoForTerminater(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 2.4 学员学时信息-终端
	List<Map<String, Object>> getStudyTimeQueryForTerminater(
			@Param("Stunum") String Stunum, @Param("Subject") String Subject)
			throws DataAccessException;

	// 2.6 电子教学日志-终端
	List<Map<String, Object>> getStudyRecordResultForTerminater(
			@Param("Stunum") String Stunum) throws DataAccessException;

	// 2.7 添加操作日志-终端
	int addOperateLog(Map<String, Object> paramsMap) throws DataAccessException;

	// 根据设备编号查VehicleId-人脸识别
	Integer getVehicleIdForFaceCheck(@Param("Devnum") String Devnum)
			throws DataAccessException;

	// 根据设备编号查GpsId-人脸识别
	Integer getGpsIdForFaceCheck(@Param("VehicleId") Integer VehicleId)
			throws DataAccessException;

	// 根据学员全国编号查UID-人脸识别
	String getUIDForFaceCheck(@Param("Stunum") String Stunum)
			throws DataAccessException;

	// 根据学员身份证UID查重-人脸识别
	int isExistUIDForFaceCheck(@Param("UID") String UID)
			throws DataAccessException;

	// 根据学员全国编号修改身份证UID-人脸识别
	int updateUIDForFaceCheck(@Param("UID") String UID,
			@Param("Stunum") String Stunum) throws DataAccessException;

	// 根据状态拿到课程所有信息
	List<Map<String, Object>> getCourseDetailByStatus(
			Map<String, Object> paramsMap) throws DataAccessException;

	// 根据班型ID获取班型详情
	Map<String, Object> getClassDetailById(String classId)
			throws DataAccessException;

	// 查询学员对应科目的总学时
	Map<String, Object> getTotalTimes(String driverType)
			throws DataAccessException;

	// 查询学员对应科目的已学学时
	Map<String, Object> getStudyTimes(String studentId)
			throws DataAccessException;

	// 查询对应科目的在线视频总学时
	Map<String, Object> getTotalOnlineVedio(String subjectId)
			throws DataAccessException;

	// 查询对应科目的在线视频已学学时
	Map<String, Object> getStudyOnlineVedio(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 查询学员对应科目模拟分数
	Map<String, Object> getSimulateScore(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 根据学生获得教练信息
	Map<String, Object> selectTeacherByStudent(Map<String, Object> paramsMap)
			throws DataAccessException;

	// 判断电话号码是否是注册号码
	Map<String, Object> selectAcountByPhone(@Param("mobilephone") String mobilephone)
			throws DataAccessException;
	
	//获取教练所在的驾校
	Map<String, Object> getDriverByTeacher(String teacherId)
					throws DataAccessException;
	//添加教练或驾校评价
	int addStudentEvaluate(Map<String, Object> valMap)throws DataAccessException;
	//添加视频评价
	int addVideoEvaluate(Map<String, Object> valMap)throws DataAccessException;
	
	//测试事务
	int updateUserInfo(int userId)throws DataAccessException;	
	//测试多参数
	int InsertInfo(Map<String, Object> map)throws DataAccessException;

	//获取教练或驾校的评价
	List<Map<String, Object>> getStudentEvaluate(Map<String, Object> valMap) throws DataAccessException;
	
	//获取视频的评价
	List<Map<String, Object>> getVideoEvaluate(@Param("videoId") String videoId,
			@Param("imgUrl") String imgUrl) throws DataAccessException;
	
	//查询教练或驾校评价次数
	int checkStudentEvaluateOne(Map<String, Object> valMap)throws DataAccessException;	
	
	//查询视频评价次数
	int checkVideoEvaluateOne(Map<String, Object> valMap)throws DataAccessException;
	
	//查询课程评价次数
	int checkCourseEvaluateOne(Map<String, Object> valMap)throws DataAccessException;	
	
	//查询课程结束时间
	String getCourseEndDate(Map<String, Object> valMap)throws DataAccessException;	
	
	//查询学员该课程是否缺勤
	String isAbsence(Map<String, Object> valMap)throws DataAccessException;	
	
	//获取视频学习记录
	List<Map<String, Object>> getVideoRecordList(@Param("userId") String userId) throws DataAccessException;
	
	//获取模拟考试记录
	List<Map<String, Object>> getExamRecordList(@Param("userId") String userId) throws DataAccessException;

	// // 插入异常日志
	int writeAbnormalLog(List<Map<String, Object>> listMap) throws DataAccessException;
	
	// 根据学员全国编号查UID-人脸识别
	Map<String, Object> getDevnumByPhone(@Param("factoryNo") String factoryNo) throws DataAccessException;
}
